<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>紫色鹭</title>
    <link rel="stylesheet" href="../css/common.css">
    <link rel="stylesheet" href="../css/style_zj.css">
    <link rel="stylesheet" href="../css/style.css">
</head>
<body>
<div id="header_01_html">
    <iframe id="header_01" src="head_01.html" frameborder="0"></iframe>
</div>
<div id="head_search_html">
    <iframe id="head_search" src="head_search.html" frameborder="0"></iframe>
</div>
<div class="container store_manage clearfix">
    <div class="store_tab">
        <a mhref="store_info.html" class="store-info">基本信息</a>
        <a mhref="store_banner.html" class="banner-admmin" v-show="storeId!=false?true:false">轮播管理</a>
        <a mhref="store_product.html" class="product-admin">商品管理</a>
        <a class="active">订单管理</a>
        <a class="has_store store-enter">企业认证</a>
        <!--<a mhref="store_evaluate.html" class="evaluate-admin">评价管理</a>-->
    </div>
    <div class="right">
        <div class="text-tap">
            <div :class="!state?'list active-sty1':'list'">全部订单<span v-show="state==''?true:false">[{{total}}]</span></div>
            <div :class="state == 1?'list active-sty1':'list'" :state="1">待付款<span v-show="state==1?true:false">[{{total}}]</span></div>
            <div :class="state == 2?'list active-sty1':'list'" :state="2">待发货<span v-show="state==2?true:false">[{{total}}]</span></div>
            <div :class="state == 3?'list active-sty1':'list'" :state="3">待确认收货<span v-show="state==3?true:false">[{{total}}]</span></div>
            <div :class="state == 4?'list active-sty1':'list'" :state="4">交易成功<span v-show="state==4?true:false">[{{total}}]</span></div>
            <div :class="state == 5?'list active-sty1':'list'" :state="5">交易关闭<span v-show="state==5?true:false">[{{total}}]</span></div>
            <div :class="state == 6?'list active-sty1':'list'" :state="6">已评价<span v-show="state==6?true:false">[{{total}}]</span></div>
        </div>
        <div class="mart-23">
            <table class="table-show" style="margin-bottom: 10px;">
                <thead>
                <tr class="data-list">
                    <th class="td-w1">货品</th>
                    <th class="td-w2">单价</th>
                    <th class="td-w3">数量</th>
                    <th class="td-w4">实付款（元）</th>
                    <th class="td-w5">订单状态</th>
                    <th class="td-w6">交易操作</th>
                </tr>
                </thead>
            </table>
        </div>
        <!--<div class="check-content">-->
            <!--<span class="icon_checkbox"></span><span>全选</span>-->
        <!--</div>-->
        <div class="data-list">
            <div class="list" v-for="items in list">
                <div class="top">
                    <!--<span class="icon_checkbox marr-7"></span>-->
                    <span>订单号：</span>
                    <span class="marr-35">{{items.id}}</span>
                    <span>下单时间：</span>
                    <span>{{items.crtTime}}</span>
                    <div class="fr store_name">
                        <span class="icon_store v-tt marr-13"></span>
                        <span>{{items.storeName}}</span>
                    </div>
                </div>
                <table>
                    <tbody>
                    <tr v-for="item in items.commodties">
                        <td class="td-w1 text-l">
                            <div class="img-png">
                                <img v-for="(it,index) in item.picUrl" v-if="index == 0" :src="imgBaseUrl + it" alt="">
                            </div>
                            <span class="img-text">{{item.commodityName}}</span>
                        </td>
                        <td class="td-w2">¥{{item.retailPrice}}</td>
                        <td class="td-w3">{{item.count}}</td>
                        <td class="td-w4">
                            <div class="col-red1">¥{{item.marketPrice}}</div>
                            <!--<div>(含运费100)</div>-->
                        </td>
                        <td class="col-red1 td-w5">
                            <span v-if="items.state == 1">待付款</span>
                            <span v-if="items.state == 2">待发货</span>
                            <span v-if="items.state == 3">待确认收货</span>
                            <span v-if="items.state == 4">交易成功</span>
                            <span v-if="items.state == 5">交易关闭</span>
                            <span v-if="items.state == 6">已评价</span>
                        </td>
                        <td class="td-w6">
                            <div class="button" v-if="items.state == 2" @click="send(items.id)">已发货</div>
                            <div class="button" @click="goDetail(items.id)">订单详情</div>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<div class="tabRight">
    <div class="first">
        <ul>
            <li><a target="_blank" class="icon_admin_white" title=""></a></li>
            <li>
                <a target="_blank" class="go-shopcard c-fff">
                    <i class="icon_shopcar_white"></i>
                    <p class="mt10">购<br>物<br>车</p>
                    <span class="car-num pos-Sty1">0</span>
                </a>
            </li>
            <li>
                <a target="_blank" class="icon_list_white mt10 go-myorder" title="订单"></a>
                <a target="_blank" class="icon_collect_white mt10 go-myhas" title="收藏"></a>
                <a target="_blank" class="icon_history_white mt10 go-record" title="记录"></a>
            </li>
        </ul>
    </div>
    <div class="second">
        <a target="_blank" class="icon_edit_white"></a>
        <a target="_blank" class="icon_top_white mt10"></a>
    </div>
</div>
<script src="../js/config.js"></script>
<script>

    var limit = 10;
    var state = getUrlParam("state")?getUrlParam("state"):'';
    var offset = 1;
    var count;
    var app = new Vue({
        el: '.store_manage',
        data: {
            list:'',
            imgBaseUrl:imgBaseUrl,
            state:state,
            type:localStorage.getItem('type'),
            storeId:localStorage.getItem('storeId'),
            total:'',
        },
        beforeCreate: function () {
            get_ajaxPage("/sys/order/getMerchantPage", {limit: limit, offset: offset,state:state}, function (data) {
                data.data.forEach(function (items) {
                    items.commodties.forEach(function (item) {
                        item.picUrl?item.picUrl = item.picUrl.split(","):'';
                    })
                })
                app.list = data.data
                app.total = data.count;
            })
        },
        updated: function () {

        },
        methods:{
            send:function (id) {
                get_ajaxPage("/sys/order/shipped", {id: id}, function (data) {
                    get_confirm("确认立即发货？",function () {
                        location.reload();
                    })
                })
            },
            goDetail:function (e) {
                window.open('order_detail.html?id='+e+'&boss=boss');
            }
        }
    })

    $("body").on("click",".text-tap .list",function () {
        var href = "store_manage.html";
        href = $(this).attr("state")?href+"?state="+$(this).attr("state"):href;
        location.replace(href);
    })
</script>
</body>
</html>